<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/static/common/default.jsp"%>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	</head>
	
	<body>
		<div class="breadcrumbs" id="breadcrumbs">
	
			<ul class="breadcrumb">
				<li><i class="icon-home home-icon"></i> <a href="#">首页</a></li>
				<li>年级管理</li>
				<li class="active">添加</li>
			</ul>
			
		</div>
		
		<div class="page-content">
			<div class="page-header">
							
			</div> 
			<div class="row">
				<div class="col-xs-12">
					<form class="form-horizontal" onsubmit="return sysUserInfoAdd();" role="form" id="sysUserForm" name="sysUserForm" method="post">
						
						<div class="form-group" >
							<label class="col-sm-3 control-label no-padding-right" for="form-field-1">年级名称</label>
							<div class="col-sm-9">
								<input type="text" id="name"  name="name" value="" placeholder="年级名称" class="col-xs-10 col-sm-5" size="50" required/>
							</div>
						</div>
						
						<div class="form-group" >
							<label class="col-sm-3 control-label no-padding-right" for="form-field-1">年级编号</label>
							<div class="col-sm-9">
								<input type="text" id="order"  name="order" value="" placeholder="年级编号" class="col-xs-10 col-sm-5" size="50" required/>
							</div>
						</div>
						<div class="clearfix form-actions">
							<div class="col-md-offset-3 col-md-9">
								<button class="btn btn-info" type="submit">
									<i class="icon-ok bigger-110"></i>提交
								</button>
							</div>
						</div>
						
					</form>		
				</div>
							
			</div>
		</div>
		
		<script type="text/javascript">
			function sysUserInfoAdd() {
					var datastr = new Object();
	    			datastr.name = $('#name').val();
	    			datastr.order = $('#order').val();
					var result = true;
					$.ajax({
    		        async: true,
    		        type:"POST",
    		        data:JSON.stringify(datastr),
    		        url: "${ctx}/sys/grade/add",
    		        dataType: "json",
    		        headers : {  
                        'Content-Type' : 'application/json;charset=utf-8'  
                    },
	                    success : function(data) {
	                    	alert("data==="+data);
	                		if (data != undefined && data.status != undefined
	                				&& data.status.trim() == '0') {
	                			result = true;
	                			alert("保存成功！");
	                		} else {
	                			result = false;
	                			alert(data.error);
	                		}
	                	},
	    			},"json");
				return false;
			}
			
			
		</script>
	</body>


</html>